﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ObserverEvent
{
    class CatSubject : Subject
    {
        public delegate void EventHandler();
        public event EventHandler Update;

        public void Notify()
        {
            Console.WriteLine("小猫铃铛响了!");
            if(Update != null)
            {
                Update();
            }
        }
    }
}
